home *** CD-ROM | disk | FTP | other *** search
/ JCSM Shareware Collection 1996 September / JCSM Shareware Collection (JCS Distribution) (September 1996).ISO / communic / commo65.zip / SAMPLES.MAC < prev    next >
Text File  |  1995-07-15  |  11KB  |  288 lines

  1.                   ┌───────────────────────────┐
  2.                   │ Additional Macro Examples │
  3.                   └───────────────────────────┘
  4.  
  5. This file contains a number of sample macros.  They may need to be modified to
  6. work for you.  Feel free to copy any of them to COMMO.MAC or to an auxiliary
  7. Macro File.
  8.  
  9.  
  10.  Macros used with external Zmodem drivers
  11.  ───────────────────────────────────────────────────────────────────────────
  12.  
  13. For OMEN Technology programs, add the following macros at the top of COMMO.MAC
  14. (if necessary, substitute "dsz.com" or "dsz.exe" for "gsz.exe"):
  15.  
  16.   {:z_recv}
  17.   {exec-d %protodir\gsz.exe portx %_pad,%_irq ha both rz -mr %pr_down}
  18.   {call ring_alarm} {retu}
  19.  
  20.   {:z_send}
  21.   {exec-d %protodir\gsz.exe portx %_pad,%_irq ha both sz -mr %pr_file}
  22.   {call ring_alarm} {retu}
  23.  
  24. For TEXAS Zmodem, add the following:
  25.  
  26.   {:z_recv}
  27.   {exec-d %protodir\txzm.exe -c%_pad,%_irq -l%_spe -b%_mod -h -q -r %pr_down}
  28.   {call ring_alarm} {retu}
  29.  
  30.   {:z_send}
  31.   {exec-d %protodir\txzm.exe -c%_pad,%_irq -l%_spe -b%_mod -h -q -s %pr_file}
  32.   {call ring_alarm} {retu}
  33.  
  34. For other Zmodem drivers, adapt the program's command line to create macros
  35. similar to the above.
  36.  
  37.  
  38.  Exit {COMMO} with prompt (safe exit)
  39.  ───────────────────────────────────────────────────────────────────────────
  40.   {:alx} {info-qs0 Really exit?}
  41.          {ifco ,alxn} {exit} {:alxn} {}
  42.  
  43.  
  44.  Generic login macro
  45.  ───────────────────────────────────────────────────────────────────────────
  46. My generic login macro will login to most popular BBS's.  The generic login
  47. subroutine can be called from mail run macros, etc.  The GOLOok with
  48. ";passwor" ignores the string "password" in the opening instructions on an
  49. Auntie board.  Put {login} in your Dialing Directory macro field.
  50.  
  51.   {:login} {capture y,c:\commo\commo.cap}      RBBS, PCBoard, Auntie, etc.
  52.            {asci ,} {call gls} {}
  53.  
  54.  Generic login subroutine
  55.  ───────────────────────────────────────────────────────────────────────────
  56.   {:gls} {setlook 60,hng,10,|}
  57.          {setv ss_r,~|} {setv ss_yr,~y|}
  58.   {:li1} {sslo ss_r,(enter)}            {sslo ss_yr,graphics (enter)}
  59.          {calo li1,li2,first name}      {calo li1,li3,last name}
  60.          {sslo ss_yr,is this correct}   {golo li1,;passwor}
  61.          {lookfor password}             {send ~%_pas|} {return}
  62.   {:li2} {send ~Firstname|} {return}
  63.   {:li3} {send ~Lastname|} {return}
  64.  
  65.  
  66.  Start mail reader after a mail run
  67.  ───────────────────────────────────────────────────────────────────────────
  68.   {:cf3} {exec-ns slmr} {}                     SLMR Reader w/swap
  69.  
  70.  
  71.  Macros used at session termination
  72.  ───────────────────────────────────────────────────────────────────────────
  73. These two utilities are used in various macros.  "hng" will hangup when
  74. necessary, then "ncr" will wait for carrier detect to drop and continue
  75. dialing numbers that are still marked.
  76.  
  77.   {:hng} {pause 3} {hangup y}
  78.   {:ncr} {pause 1} {ifcarrier ncr} {pause 5} {dial ,} {beep} {}
  79.  
  80.  
  81.  PCBoard generic mailrun
  82.  ───────────────────────────────────────────────────────────────────────────
  83. Here is a macro using variables to do a mail run on a PCBoard with CAM-Mail,
  84. Rosemail, QMail, etc.  It will download only one packet each day and upload a
  85. reply packet if one exists (deleting the packet if the upload is successful),
  86. then log off.
  87.  
  88. This macro should be placed in a separate Macro File.  E.g., PCBMAIL.MAC.
  89.  
  90. Five variables must be set prior to starting this macro.  For convenience,
  91. these can be set in the Dialing Directory entry.  For example, to call Channel
  92. 1 and use the CAM-Mail door, the Dialing Directory entry (all on one line!)
  93. would be:
  94.  
  95.   Channel1        11/06/94  {1 617 354 5776} {password} ...
  96.       ...  {start,pcbmail.mac} {} {bbsid,channel1} {opendoor,mail} ...
  97.       ...  {maildoor,cam-mail} {nomsgs,no new messages} {ptim,3}
  98.  
  99. When a connection is made, {COMMO} will load PCBMAIL.MAC and GOTO the label
  100. "start".  If nodes are labeled "Channel11", "Channel12", etc., they will all
  101. be UNMArked when the macro starts.
  102.  
  103.   {:start}
  104.         {setv ss_r,~|}          Variables for SSLOoks
  105.         {setv ss_y,~y}            (These may be defined in COMMO.SET
  106.         {setv ss_yr,~y|}           using "set" items.  Then they can
  107.         {setv ss_n,~n}             be used in other macros, too.)
  108.         {setv ss_nr,~n|}
  109.         {setv ss_c,~c}
  110.         {setv ss_ee,~~~~^[~^[}
  111.  
  112.         {unmark %bbsid%1,%bbsid%2,%bbsid%3,%bbsid%4,%bbsid%5}
  113.         {setv qwkfil,c:\slmr\store\%bbsid.qwk}
  114.         {capm filter}
  115.         {capt y,c:\cap\%bbsid.%_day} {asci ,}
  116.         {setl 30,hng}
  117.         {sslo ss_ee,press escape}
  118.         {sslo ss_ee,<esc> twice}
  119.         {golo ,pcboard (r)}
  120.         {look ^g}
  121.         {call gls}
  122.         {setl 60,hng,%ptim,n|}
  123.         {sslo ss_r,to continue}
  124.         {sslo ss_nr,(enter)=yes?}
  125.         {sslo ss_nr,(H)elp, More?}
  126.         {sslo ss_c,(C)ontinue}
  127.         {golo ,channel 1 command?}
  128.         {look main board command?}
  129.         {setl 120,hng}  ** turn off prompt timer
  130.         {send open %opendoor|}
  131.         {look %maildoor command}
  132.         {file %qwkfil} {ifco ,mr_dl}
  133.         {comp _ffd,%_dat} {ifco mr_ul}   ** only one .QWK per day
  134.   {:mr_dl}
  135.         {send d|}
  136.         {golo mr_ul,%nomsgs} {sslo ss_yr,when done?}
  137.         {sslo ss_yr,(y/n)} {sslo ss_yr,receive these}
  138.         {look %bbsid.qwk}
  139.         {call mail_dn} {look %maildoor command}
  140.         {ifex %qwkfil,,mr_dl}  ** if error, try again
  141.   {:mr_ul}
  142.         {ifex %uldir\%bbsid.rep,,mr_gb}  ** if reply, upload it
  143.         {send u|} {look %bbsid.rep} {call mail_up}
  144.         {look %maildoor command} {ifcon ,mr_ul} ** if error, try again
  145.   {:mr_gb}
  146.         {send g|} {goto hng}
  147.  
  148.  
  149.  WildCat! generic mailrun
  150.  ───────────────────────────────────────────────────────────────────────────
  151. The following macro does a mail run on most WildCat! BBS's with the wcMAIL
  152. mail door.  The only variables that need to be set are "bbsid" and "ptim."
  153. The "ss_" variables may be set in the Setup File (using the "set" keyword).
  154.  
  155. This macro should be placed in a separate Macro File.  E.g., CATMAIL.MAC.
  156.  
  157.   {:catmail}
  158.         {setv ss_ee,~^[^[}
  159.         {setv ss_r,~|}
  160.         {setv ss_y,~y}         ** These assume "hotkeys" are set
  161.         {setv ss_n,~n}
  162.         {setv ss_bday,~mm-dd-yy|}      <- your birthdate
  163.         {setv ss_pnum,~614-326-1309|}  <- your phone number
  164.         {setv ss_name,~First Last|}    <- your name
  165.  
  166.         {unmark %bbsid%1,%bbsid%2,%bbsid%3,%bbsid%4,%bbsid%5}
  167.         {setv qwkfil,c:\slmr\store\%bbsid.qwk}
  168.         {capm filter}
  169.         {capt y,c:\cmsg\%bbsid.%_day} {asci ,}
  170.         {setl 60,hng}
  171.         {sslo ss_ee,twice}
  172.         {sslo ss_r,[c]ontinue}
  173.         {sslo ss_name,first name}
  174.         {look password?} {send %_pas|}
  175.         {setl 120,hng,%ptim,|}
  176.         {sslo ss_r,[c]ontinue}
  177.         {sslo ss_r,[enter]}
  178.         {sslo ss_n,choice? [ ]}
  179.         {sslo ss_bday,birth date}
  180.         {sslo ss_pnum,phone number}
  181.         {sslo ss_n,bulletin menu?}
  182.         {golo ,push a key}              ** Various main menu prompts
  183.         {golo ,your command}
  184.         {look main menu:} {send ~~m}
  185.         {golo ,push a key}              ** Various message menu prompts
  186.         {golo ,your command}
  187.         {look message menu:} {send ~~d}
  188.   {:wc_md}
  189.         {setl 120,hng}  ** turn off prompt timer
  190.         {sslo ss_r,[c]ontinue}
  191.         {golo ,tomcat menu}
  192.         {look wcmail command}
  193.         {file %qwkfil} {ifco ,wc_dl}
  194.         {comp _ffd,%_dat} {ifco wc_ul}   ** only one .QWK per day
  195.   {:wc_dl}
  196.         {pause 1} {send d}
  197.         {golo wc_ul,nothing found}
  198.         {sslo ss_y,receive this packet}
  199.         {look %bbsid.qwk now}
  200.         {call mail_dn}
  201.         {golo ,tomcat menu}
  202.         {look wcmail command}
  203.         {ifex %qwkfil,,wc_dl}  ** if error, try again
  204.         {exec-n c:\slmr\weldel.bat %bbsid}      ** delete welcome, etc.
  205.   {:wc_ul}
  206.         {ifex %uldir\%bbsid.rep,,wc_bye}  ** if reply, upload it
  207.         {pause 1} {send u}
  208.         {look %bbsid.rep} {call mail_up}
  209.         {golo ,tomcat menu}
  210.         {look wcmail command}
  211.         {ifcon ,wc_ul}  ** if error, try again
  212.   {:wc_bye}
  213.         {pause 1} {send g}
  214.         {setl 2,hng}
  215.         {look logoff [y/n]} {send y}
  216.         {pause 1} {goto hng}
  217.  
  218.  
  219.  Mail download and upload subroutines
  220.  ───────────────────────────────────────────────────────────────────────────
  221. The mail download subroutine will rename your .QWK packets, keeping the last
  222. six packets for each BBS.  Mail upload will delete your .REP packet if the
  223. upload is successful.  These routines use Zmodem.  You may want to change the
  224. directories used.
  225.  
  226.   {:mail_dn}
  227.         {ifex c:\slmr\store\%bbsid.qwk,,mail_dn1}
  228.         {exec-n del c:\slmr\store\%bbsid.1 > nul}
  229.         {exec-n ren c:\slmr\store\%bbsid.2 %bbsid.1 > nul}
  230.         {exec-n ren c:\slmr\store\%bbsid.3 %bbsid.2 > nul}
  231.         {exec-n ren c:\slmr\store\%bbsid.4 %bbsid.3 > nul}
  232.         {exec-n ren c:\slmr\store\%bbsid.5 %bbsid.4 > nul}
  233.         {exec-n ren c:\slmr\store\%bbsid.qwk %bbsid.5 > nul}
  234.   {:mail_dn1}
  235.         {setv pr_down,c:\slmr\store}
  236.         {setv pr_alarm,0}
  237.         {look ^XB00}
  238.         {call z_recv}
  239.         {ifer 1,,mail_dn2}
  240.         {exec-n del c:\slmr\store\%bbsid.qwk}
  241.   {:mail_dn2}
  242.         {return}
  243.  
  244.   {:mail_up}
  245.         {setv pr_file,%uldir\%bbsid.rep}
  246.         {setv pr_alarm,0}
  247.         {call z_send}
  248.         {ifer 1,mail_up1}
  249.         {exec-N del %uldir\%bbsid.rep}
  250.   {:mail_up1}
  251.         {comp %_err,0} {return}
  252.  
  253.  
  254.  Message reading macros
  255.  ───────────────────────────────────────────────────────────────────────────
  256. These two macros are used for reading messages online.  They use the grey plus
  257. and minus keys in the lower right corner of the keyboard.  The first one sends
  258. a <cr>, then clears the screen.  Makes messages a lot easier to read since
  259. each one starts displaying at the top of the screen.  The second macro just
  260. sends a <cr>.  Nice for keyboards without the extra Enter key.
  261.  
  262.   {:gr+} {send |} {clear} {}
  263.   {:gr-} {send |} {}
  264.  
  265.  
  266.  History macro
  267.  ───────────────────────────────────────────────────────────────────────────
  268. Here is an online history macro.  It allows you to resend anything that
  269. appeared on the screen (commands, message quotes, etc.).  You must have
  270. Scrollback enabled.
  271.  
  272. It first saves the Screen Image File pathname in the variable "scrsav" (in
  273. case you have stuff in that file you want to keep).
  274.  
  275. Then it sets the Screen Image File to a temporary file and goes into
  276. Scrollback.  In Scrollback you use the "W" command to write out the lines
  277. containing the data you want to resend.  Press Esc and edit the data.
  278.  
  279. Save the file and press Esc to exit the editor.  The macro then does an ASCII
  280. Upload of the file and deletes it.  Then the Screen Image pathname is restored
  281. to what it was before.
  282.  
  283.   {:cf6} {setv scrsav,%_scr} {screen n,%dldir\temp} {scroll}
  284.          {edit %_scr} {asci %_scr} {exec-N del %_scr}
  285.          {screen n,%scrsav} {}
  286.  
  287.                                 - end -
  288.